#!/bin/bash
rpm -qc rsync&>/dev/null
if [ $? -eq 0 ]
then
    echo rsync已安装
else
    echo rsync没有安装
    read -p "是否安装rsync?(yes/no) " n1
    case $n1 in
    yes|y|Y|YES)
    yum -y install rsync&>/dev/null
    ;;
    NO|N|n|no)
    echo 即将退出 && sleep 2
    ;;
    esac
fi
rpm -qa |grep inotify&>/dev/null
if [ $? -eq 0 ]
then
    echo inotify已安装
else
    echo inotify没有安装
    read -p "是否安装inotify?(yes/no) " n2
case $n2 in
    yes|y|Y|YES)
    yum -y install inotify-tools&>/dev/null
    ;;
    NO|N|n|no)
    echo 即将退出 && sleep 2
    ;;
    esac
fi